From: Keir Fraser Date: Wed, 14 Apr 2010 11:03:27 +0000 (+0100) Subject: credit2: Add context_saved scheduler callback X-Git-Tag: archive/raspbian/4.8.0-1+rpi1~1^2~12374 X-Git-Url: https://dgit.raspbian.org/%22http://www.example.com/cgi/success//%22http:/www.example.com/cgi/success/?a=commitdiff_plain;h=be9a0806e197f4fd3fa64d6535e74e16d4338a83;p=xen.git credit2: Add context_saved scheduler callback Because credit2 shares a runqueue between several cpus, it needs to know when a scheduled-out process has finally been context-switched away so that it can be added to the runqueue again. (Otherwise it may be grabbed by another processor before the context has been properly saved.) Signed-off-by: George Dunlap --- diff --git a/xen/common/schedule.c b/xen/common/schedule.c index 5b28004cc6..45d3040728 100644 --- a/xen/common/schedule.c +++ b/xen/common/schedule.c @@ -885,6 +885,8 @@ void context_saved(struct vcpu *prev) /* Check for migration request /after/ clearing running flag. */ smp_mb(); + SCHED_OP(context_saved, prev); + if ( unlikely(test_bit(_VPF_migrating, &prev->pause_flags)) ) vcpu_migrate(prev); } diff --git a/xen/include/xen/sched-if.h b/xen/include/xen/sched-if.h index ed05757730..352e43f5ef 100644 --- a/xen/include/xen/sched-if.h +++ b/xen/include/xen/sched-if.h @@ -70,6 +70,7 @@ struct scheduler { void (*sleep) (struct vcpu *); void (*wake) (struct vcpu *); + void (*context_saved) (struct vcpu *); struct task_slice (*do_schedule) (s_time_t);